<?php
class HdfsStat {
	
	public $path = null;
	public $length = null;
	public $isdir = null;
	public $block_replication = null;
	public $blocksize = null;
	public $modification_time = null;
	public $permission = null;
	public $owner = null;
	public $group = null;
	
	public function __construct($str){
		$tmp = preg_split("{\\s+}", $str);
		if($tmp[0][0] == "d") {
			$this->isdir=true;
		}
		else{
			$this->isdir=false;
		}
		$this->permission = substr($tmp[0], 1);
		$this->block_replication = $tmp[1];
		$this->owner = $tmp[2];
		$this->group = $tmp[3];
		$this->blocksize = 134217728;
		$this->length = $tmp[4];
		$this->modification_time = strtotime($tmp[5] . " " . $tmp[6]);
		$this->path = $tmp[7];
	}
}